﻿
// Transform2DView.h: CTransform2DView 类的接口
//

#pragma once
#include "Transformation.h"

class CTransform2DView : public CView
{
protected: // 仅从序列化创建
	CTransform2DView() noexcept;
	DECLARE_DYNCREATE(CTransform2DView)

// 特性
public:
	CTransform2DDoc* GetDocument() const;

// 操作
public:
	void InitFourPoints();
	void DrawCoordinate(CDC* pDC, CRect& rect);
	void DrawRectangle(CDC* pDC);

// 重写
public:
	virtual void OnDraw(CDC* pDC);  // 重写以绘制该视图
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);

// 实现
public:
	virtual ~CTransform2DView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CPoint2D leftTop;
	CPoint2D leftDown;
	CPoint2D rightTop;
	CPoint2D rightDown;


// 生成的消息映射函数
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnMoveLeft();
	afx_msg void OnMoveRight();
	afx_msg void OnMoveUp();
	afx_msg void OnMoveDown();
	afx_msg void OnScaleUp();
	afx_msg void OnScaleDown();
	afx_msg void OnRotateLeft();
	afx_msg void OnRotationRight();
	afx_msg void OnReflectionOrigin();
	afx_msg void OnRelectionX();
	afx_msg void OnRelectionY();
	afx_msg void OnReflectionYEqualX();
	afx_msg void OnReflectionYEqualNagtX();
	afx_msg void OnShearX();
	afx_msg void OnShearY();
	afx_msg void OnInitRectangle();
};

#ifndef _DEBUG  // Transform2DView.cpp 中的调试版本
inline CTransform2DDoc* CTransform2DView::GetDocument() const
   { return reinterpret_cast<CTransform2DDoc*>(m_pDocument); }
#endif

